home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q0428.dms / q0428.adf / rayshade / AmigaDOS.c next >
C/C++ Source or Header  |  1992-05-12  |  851b  |  49 lines

  1. extern long yylineno = 1;
  2.  
  3. #include <math.h>
  4.  
  5. #include <exec/types.h>
  6. #include <libraries/dos.h>
  7. #include <libraries/dosextens.h>
  8.  
  9. #ifdef LATTICE_50
  10. #include <proto/dos.h>
  11. #endif
  12.  
  13. typedef double Float;
  14.  
  15. #ifdef LATTICE_50
  16. #ifdef MFPU
  17. double __builtin_fpc(int, double);
  18. #define sqrt(d)     __builtin_fpc(0x0004,d)
  19. #endif
  20. #ifdef MFFP
  21. #include <mffp.h>
  22. #endif
  23. #endif
  24.  
  25. double hypot(double a, double b)
  26. {
  27.   return ( sqrt(a*a + b*b));
  28. }
  29.  
  30. static struct DateStamp dsOffset;
  31.  
  32. void InitRSGCTime(void)
  33. {
  34.   DateStamp(&dsOffset);
  35. }
  36.  
  37. void RSGetCpuTime(usertime, systime)
  38. Float *usertime, *systime;
  39. {
  40.   ULONG Minutes;
  41.   struct DateStamp DS;
  42.  
  43.   DateStamp(&DS);
  44.   Minutes = (DS.ds_Days - dsOffset.ds_Days)*24*60 + (DS.ds_Minute-dsOffset.ds_Minute);
  45.  
  46.   *usertime = (Float)(Minutes*60L) + (Float)(DS.ds_Tick-dsOffset.ds_Tick)/(Float)TICKS_PER_SECOND;
  47.   *systime = 0.0;
  48. }
  49.